<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
		<p:growl />
			<h:outputText value="Add Lookup Values" styleClass="outputTextTitle" /><br/>
			<h:panelGrid columns="3" style="text-align:left;" styleClass="grid" columnClasses="formLabelCell, formInputCell,lable,value" cellpadding="4" cellspacing="5">
		
		
				<h:outputText value="Select Custom Lookup" style="font-size:14px;"/>     
			 
				 <h:outputText value=":" />   
			    <p:selectOneMenu value="#{createCustomLookupValuesBean.customLookup.customLookId}" styleClass="adminSelectOneMenuWidth">
						<f:selectItem itemLabel="Select a custom lookup" itemValue=""/>
                    	<f:selectItems value="#{createCustomLookupValuesBean.customLookupsMap}" />
                    	
                 </p:selectOneMenu>
			     
			    
			  
			   <h:inputHidden />
			   <h:inputHidden  />
			      <p:commandButton value= "Add Lookup Value" actionListener="#{createCustomLookupValuesBean.toggleAddLookupDisplay}"  ajax="false"/>
			</h:panelGrid>
		
		
	<h:panelGrid columns="3" style="text-align:left;" styleClass="grid"  columnClasses="formLabelCell, formInputCell,lable,value" cellpadding="4" cellspacing="5" rendered="#{createCustomLookupValuesBean.addLookUpValue}" >
				
		          <h:outputText value="Lookup Name" style="font-size:14px;"/> 			 
				 <h:outputText value=":" />  
			     <p:inputText value="#{createCustomLookupValuesBean.lookupValue.lookupName}"/>
			     
			     <h:outputText value="Lookup value" style="font-size:14px;"/>  			 
				 <h:outputText value=":" />  
			     <p:inputText value="#{createCustomLookupValuesBean.lookupValue.lookupValue}"/> 
			     
			      
			     
			     
			     <h:outputText value="Description" style="font-size:14px;"/>  			 
				 <h:outputText value=":" />  
			     <p:inputText value="#{createCustomLookupValuesBean.lookupValue.description}" />
		<h:inputHidden  />
		<h:inputHidden />
		<p:commandButton value="Add More" action="#{createCustomLookupValuesBean.createAnotherLookupValueAction}" ajax="false" />
		
		</h:panelGrid>
		<h:panelGrid rendered="#{createCustomLookupValuesBean.addLookUpValue}">
		 
		 <p:dataTable id="customlookupTable" style="width: 80%;" var="lookUpValue" value="#{createCustomLookupValuesBean.lookupValues}">
									<p:column>
										<f:facet name="header">
											<h:outputText value="Lookup Name" />
										</f:facet>
										<h:outputText  value="#{lookUpValue.lookupName}"/>
									</p:column>
									
                                 <p:column>
										<f:facet name="header">
											<h:outputText value="Lookup Value" />
										</f:facet>
										<h:outputText value="#{lookUpValue.lookupValue}"/>
									</p:column>
						<p:column>
										<f:facet name="header">
											<h:outputText value="Description" />
										</f:facet>
										<h:outputText value="#{lookUpValue.description}"/>
									</p:column>
							
									</p:dataTable>
			
		              <p:commandButton value ="Save" action="#{createCustomLookupValuesBean.saveCustomLookup}"  ajax="false"/>
		</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>